import request from '@/utils/request'

// 获取设备管理
export function getEquipment(params) {
  return request({
    url: `/api/vm-service/vm/search`,
    method: 'get',
    params
  })
}

// 修改售货机点位
export function gputEquipment(id, nodeId) {
  return request({
    url: `/api/vm-service/vm/${id}/${nodeId}`,
    method: 'PUT'
  })
}

// 修改售货机点位
export function putGputEquipment(data) {
  return request({
    url: `/api/vm-service/vm/applyPolicy`,
    method: 'PUT',
    data
  })
}

// 货道获取

export function getCargoChannel(innerCode) {
  return request({
    url: `api/vm-service/channel/channelList/${innerCode}`,
    method: 'get'
  })
}
// 获取商圈下销量前10的商品(补货推荐)
export function getTop(businessId) {
  return request({
    url: `/api/vm-service/sku/businessTop10/${businessId}`,
    method: 'get'
  })
}
// 获取全部商品
export function getcommodity(params) {
  return request({
    url: `/api/vm-service/sku/search`,
    method: 'get',
    params
  })
}
// 上传商品
export function putcommodity(data) {
  return request({
    url: '/api/vm-service/channel/channelConfig',
    method: 'PUT',
    data
  })
}

// 查看该设备销售量
export function GETxiaoshouliang(params) {
  return request({
    url: '/api/order-service/report/orderCount',
    method: 'GET',
    params
  })
}
// 查看该设备销售额             /api/order-service/report/orderAmount  params
export function GETxiaoshouer(params) {
  return request({
    url: '/api/order-service/report/orderAmount',
    method: 'GET',
    params
  })
}
// 查看该设备补货次数
export function GETbuhuocishu(data) {
  return request({
    url: `/api/task-service/task/supplyCount/${data.innerCode}/${data.end}/${data.start}`,
    method: 'GET'
  })
}
// 查看该设备维修次数
export function GETweixiucishu(data) {
  return request({
    url: `/api/task-service/task/repairCount/${data.innerCode}/${data.end}/${data.start}`,
    method: 'GET'
  })
}
// 查看该设备商品销量（月）
export function GETshangpinxiaoliang(data1) {
  return request({
    url: `/api/order-service/report/skuCollect/${data1.innerCode}/${data1.end}/${data1.start}`,
    method: 'GET'

  })
}
// 获取设备类型管理 /api/vm-service/vmType/search?pageIndex=1&pageSize=10
// 查看该设备商品销量（月）
export function GETshebeileixing(params) {
  return request({
    url: `/api/vm-service/vmType/search`,
    method: 'GET',
    params
  })
}
// 新增售货机  /api/vm-service/vm
export function POSTshouhuoji(data) {
  return request({
    url: `/api/vm-service/vm`,
    method: 'POST',
    data
  })
}
// 新增售货机类型   新增售货机类型
export function POSTshouhuojileixing(data) {
  return request({
    url: `/api/vm-service/vmType`,
    method: 'POST',
    data
  })
}
// 修改售货机类型
export function PUTshouhuojileixing(data) {
  return request({
    url: `/api/vm-service/vmType/${data.typeId}`,
    method: 'PUT',
    data
  })
}
// 售货机类型删除
export function DELshouhuojileixing(id) {
  return request({
    url: `/api/vm-service/vmType/${id}`,
    method: 'DELETE'
  })
}
